package com.dao;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;

import com.common.BaseModel;

public interface BaseModelDAO<T extends BaseModel> {

	T find(Long id) throws DataAccessException;

	T findFULL(Long id) throws DataAccessException;

	List<T> getList() throws DataAccessException;

	T save(T object) throws DataAccessException;

	void saveList(List<T> objectList) throws DataAccessException;

	T edit(T object) throws DataAccessException;

	void delete(T object) throws DataAccessException;

	List<T> getList(String query) throws DataAccessException;

	T get(String query) throws DataAccessException;

	T get(Object query) throws DataAccessException;

	List<T> getList(Object query) throws DataAccessException;

	Long count() throws DataAccessException;

	public Long count(Map<String, Object> filters, Boolean startMode)
			throws DataAccessException;
	
	@SuppressWarnings("rawtypes")
	public List sum(Map<String, Object> filters, Boolean startMode, String... properties)
			throws DataAccessException; 

	List<T> getList(int first, int pageSize, String sortField,
			boolean sortOrder, Map<String, Object> filters, Boolean startMode)
			throws DataAccessException;

	public List<T> getList(Object query, Object query2)
			throws DataAccessException;

	List<Object[]> getListQuery(Object query) throws DataAccessException;

	List<Object[]> getList2Query(Object query) throws DataAccessException;

	public Long count(Object query) throws DataAccessException;

	public Long count(Object query, Object param) throws DataAccessException;

	public Long count(String query) throws DataAccessException;

	public Long count(String query, Object param) throws DataAccessException;
	
	public List<T> find(String queryString, Object... values)
			throws DataAccessException;

	public T findInitialize(Long id) throws DataAccessException;

	public T findBy (Long id) throws DataAccessException;
	
	public T findBy (Long id, Long id2) throws DataAccessException;

	public T findBy (String id) throws DataAccessException;

	public T findByCodigo(Long codigo) throws DataAccessException;

	public T findBy (Long idDeposito, Long idProducto, Long idProveedor) throws DataAccessException;
	
	public T buscarPor (Long idProducto, Long idProveedor) throws DataAccessException;
	
	public boolean existeNumeroDeRemitoDeCliente(Long numeroDeRemito, Long idDeCliente) throws Exception;	
	
	public List getListObjects(Object query) throws DataAccessException;
}
